home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / Imaging / Show Icon(s) < prev    next >
Encoding:
Text File  |  1999-03-04  |  736 b   |  36 lines  |  [TEXT/ToyS]

  1. on open fsObjs
  2.     set drawWin to ¬
  3.         display drawing titled ¬
  4.             "Icon Viewer" with dimensions {256, 100}
  5.     
  6.     repeat with fsObj in fsObjs
  7.         ShowOne(drawWin, fsObj)
  8.     end repeat
  9.     
  10.     display drawing drawWin with disposal
  11. end open
  12.  
  13.  
  14. on ShowOne(drawWin, fsObj)
  15.     -- Get file name
  16.     set fname to catalog name of (basic info for fsObj)
  17.     
  18.     -- Get icon as picture
  19.     set myPic to (the icon for fsObj) as picture
  20.     
  21.     -- Draw it double size (scale {2,2})
  22.     draw a picture into drawWin ¬
  23.         using data myPic ¬
  24.         offset by {96, 8} ¬
  25.         with scale {2, 2} ¬
  26.         with a clear slate
  27.     
  28.     -- Draw the name
  29.     draw a string into drawWin ¬
  30.         using data fname ¬
  31.         offset by {128, 92} ¬
  32.         using state {text size:18, text font:1}
  33.     
  34.     pause for 2 with seconds timing
  35. end ShowOne
  36.